# '''
# 主要测试cnode社区的话题相关的功能
# 主要的api包括
# 1.主题首页
# '''
#
# # 引入第三方模块
import requests
# def test_topic_page():
#     """
#     测试主题首页功能
#     get 请求方法
#     url:http://49.233.108.117:3000/api/v1/topics
#     :return:
#     """
# # 1.发生代码请求
#     res = requests.get('http://49.233.108.117:3000/api/v1/topics')
#     print(res)
# # 2.查看状态码
#     print('状态码',res.status_code)
#     # 3.查看json结果
#     print(res.json())
#
def test_create_topics():
    """
    创建主题
    :return:
    """
    create_url= 'http://49.233.108.117:3000/api/v1/topics'
    post_data= {'accesstoken':'8aac85ba-e4b2-4093-ac23-b4154fcca626',
                'title':'主题aaaaaaaa','tab':'ask','content':'hahhaaaaaaaaa'}
    res=requests.post(url=create_url,data=post_data)

    print(res.status_code)
    print(res.json())
test_create_topics()

#
#
# test_topic_page()
# test_create_topics()

# import requests
# accesstoken='cbeb58cd-9dd0-4b77-b333-d96fd9da7365'
# def test_get_topic():
#     get_topic_url='http://49.233.108.117:3000/api/v1/topics'
#     get_topic_data={
#         'page':'1',
#         'tab':'job',
#         'limit':'1',
#         'mdrender':'true'
#     }
# test_get_topic()
#     res=requests.get(url=get_topic_url,params=get_topic_data)
#     print(res)
#
# def test_get_topic_details():
#     test_get_topic_details_url='http://49.233.108.117:3000/api/v1/topic/id'
#     test_get_topic_details_data={
#         'mdrender':'true',
#         'accesstoken':accesstoken
#     }
#     res=requests.get(url=test_get_topic_details_url,params=test_get_topic_details_data)
#     print(res)

# d={'a':'b','c':'d'}
# i=d['c']
# print(d)